import react from '@vitejs/plugin-react';
import {
    defineConfig,
} from 'vite';
import {
    VitePWA, 
} from 'vite-plugin-pwa'



// https://vitejs.dev/config/
export default defineConfig({
    plugins: [
        react(),
        VitePWA({
            registerType: 'autoUpdate',
            manifest: {
                name: '媒体推送',
                short_name: '媒体推送',
                description: '局域网内媒体推送',
                display: 'standalone',
				theme_color: '#1976d2',
                icons: [
					{
                        src: '/icon.png',
                        sizes: '128x128',
                        type: 'image/png',
                    },
					{
                        src: '/icon.png',
                        sizes: '256x256',
                        type: 'image/png',
                    },
                    {
                        src: '/icon.png',
                        sizes: '512x512',
                        type: 'image/png',
                    },
                ],
            },
        }),
    ],
    build: {
        outDir: '../../assets',
    },
    server: {
        port: 3001,
        proxy: {
            '/api': {
                target: 'http://localhost:8082',
            },
        },
    },
});
